package cn.com.surker.sale.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * <p>
 * 销售客户表
 * </p>
 *
 * @author admin
 * @since 2024-06-18
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class SaleClient implements Serializable {

	private static final long serialVersionUID = 1L;

	//	税号类型,公司
	public static final int TAX_CODE_TYPE_COMPANY = 1;
	//	税号类型,个人
	public static final int TAX_CODE_TYPE_PERSON = 2;



	public SaleClient() {
	}

	public SaleClient(String name, String fullName, String taxCode, String linkMan, String phone, String address, String email, Integer type, Integer status, String creater, Date createTime) {
		this.name = name;
		this.fullName = fullName;
		this.taxCode = taxCode;
		this.linkMan = linkMan;
		this.phone = phone;
		this.address = address;
		this.email = email;
		this.type = type;
		this.status = status;
		this.creater = creater;
		this.createTime = createTime;
	}

	/**
	 * 标识
	 */
	@TableId(value = "id", type = IdType.AUTO)
	private Long id;

	/**
	 * 编号
	 */
	private String code;

	/**
	 * 客户名称
	 */
	private String name;

	/**
	 * 客户全称
	 */
	private String fullName;

	/**
	 * 纳税人识别号
	 */
	private String taxCode;

	/**
	 * 客户联系人
	 */
	private String linkMan;

	/**
	 * 客户联系电话
	 */
	private String phone;

	/**
	 * 联系地址
	 */
	private String address;

	/**
	 * email
	 */
	private String email;

	/**
	 * 客户类型:1企业;2:个人
	 */
	private Integer type;

	public Integer getType() {
		if (type == null) {
			return 1;
		}
		return type;
	}

	/**
	 * 状态(0:启用1：禁用)
	 */
	private Integer status;

	/**
	 * 审核备注，当审核结果为不通过时，必填
	 */
	private String remark;

	/**
	 * 创建人
	 */
	private String creater;

	/**
	 * 创建日期
	 */
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
	private Date createTime;

	/**
	 * 更新人
	 */
	private String updater;

	/**
	 * 更新日期
	 */
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
	private Date updateTime;

	@TableField(exist = false)
	private Long erpId;
	/**
	 * 工厂ID,改为从子标关联查询
	 */
	@TableField(exist = false)
	private String orgName;

	@TableField(exist = false)
	private List<SaleClientOrg> orgList = new ArrayList<>();

}
